import Blender
from Blender.BGL import *
from Blender import Draw
R = G = B = 0
A = 1
title = "Testing BGL  + Draw"
instructions = "Use mouse buttons or wheel to change the background color."
quitting = " Press ESC or q to quit."
len1 = Draw.GetStringWidth(title)
len2 = Draw.GetStringWidth(instructions + quitting)
#
def show_win():
	glClearColor(R,G,B,A)                # define color used to clear buffers 
	glClear(GL_COLOR_BUFFER_BIT)         # use it to clear the color buffer
	glColor3f(0.35,0.18,0.92)            # define default color
	
	glBegin(GL_POLYGON)                  # begin a vertex data list
 	glVertex2i(165, 158)
  	glVertex2i(265, 158)
  	glVertex2i(265, 258)
	glVertex2i(165, 258)
  	glEnd()

#


Draw.Register(show_win, None)      # start the main loop
